home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 2 / L'Effet Pommier - Volume 02.iso / Echecs / GNU Chess Pro / GNU Chess Docs / GNU⁄porting < prev    next >
Text File  |  1993-10-05  |  2KB  |  25 lines

  1.  
  2. This is a note how to port GNUChess to machines with scarce memory: GNUChess minimal requirements are:
  3.     Ñ approximately 100 kByte memory for the executable program.
  4.     Ñ at least 200 kByte for data structures.
  5. You don╒t want to port GNUChess to a machine with less memory than that.
  6.  
  7. GNUChess is optimized for speed and that means that memory has been used when there has been a tradeoff between memory usage and speed. If you intend to run GNUChess on a machine with less than 2 Mbyte memory the size of some data structures have to be reduced. Here is a list of the largest data structures in GNUChess, their sizes and a small comment on what can be done to reduce their size:
  8.  
  9. ttable:    1.3    MByte    (#define ttblsz <something small>)
  10. nextpos:    32    kByte        (nothing save rewiting all move generation)
  11. nextdir:    32    kByte        (nothing save rewiting all move generation)
  12. Tree:        20    kByte        (change f,t to unsigned char)
  13. history:    8    kByte     (can be removed)
  14. distdata:    8    kByte        (can be changed to a macro)
  15. taxidata:    8    kByte        (can be changed to a macro)
  16. hashcode:    7    kByte        (#define ttblsz 0)
  17.  
  18. First of all, start by reducing the transposition table size, this is done by setting ttblsz in (gnuchess.c). If the transposition table does not fit entirely in memory it will have a detrimental effect on performance. You can remove the transposition table by setting ttblsz 0. If this isn╒t enough, reconsider if you really want to do this port. There isn╒t really that much to gain by changing the other data structures. 
  19.  
  20. Here are the macros:
  21. #define taxicab(a,b) (abs(column (a) - column (b)) + abs (row (a) - row (b)))
  22. #define distance(a,b) \
  23.     ((abs(column (a) - column (b)) > abs (row (a) - row (b)))
  24.     ? abs(column (a) - column (b)) : abs (row (a) - row (b)))
  25.